/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.HashSet;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * <p>Project: javase - Stream5
 * <p>Powered by webrx On 2021-12-22 17:54:11
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream10 {
    public static void main(String[] args) {


        var st = Stream.of(
                new Student(1, "lisi1", 22, "男"),
                new Student(2, "lisi2", 22, "女"),
                new Student(3, "lisi3", 18, "男"),
                new Student(4, "lisi4", 18, "女"),
                new Student(5, "lisi5", 28, "女"),
                new Student(5, "lisi6", 28, "男"),
                new Student(7, "jack6", 38, "女"));

        //var mm = st.collect(Collectors.groupingBy(Student::getGender));
        //System.out.println(mm);

        //Map<key,List<Student>> aa
        var aa = st.collect(Collectors.groupingBy(Student::getAge));
        System.out.println();

    }
}
